package com.yinhe.music.yhmusic.personal.feedback;

import com.yinhe.music.yhmusic.base.BasePresenter;
import com.yinhe.music.yhmusic.base.IBaseModel;

public class FeedbackPresenter extends BasePresenter<IBaseModel, FeedbackContract.IFeedbackView> implements FeedbackContract.IFeedbackPresenter {
    @Override
    public void sendFeedback(String content) {
        if (getView() == null) {
            return;
        }

        addSubscription(mModel.feedBack(content)
                .compose(schedulerProvider.applySchedulers())
                .subscribe(baseInfo -> {
                    getView().setFeedBack(baseInfo.getMsg(),baseInfo.getCode());
                }, throwable -> {
                    getView().showMessage(throwable);
                }));
    }
}
